home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 19 / Night Owl (The Best of Shareware)(NOPV 19)(1996).ISO / 007a / tgbbsed1.zip / TGBBSED.PAS < prev   
Pascal/Delphi Source File  |  1995-11-25  |  5KB  |  147 lines

  1. {Telegard 3.0 BBS List Freeware Editor}
  2. {This program canot be used or modified for profit}
  3. Program TGBBSED;
  4. USES DOS,CRT;
  5. TYPE {Taken from Telegard developement package}
  6.   unixtime  = longint;
  7.  
  8.   bbslistrec=           { *.BBS : BBS Listings }
  9.   record
  10.      phone          : string[20];             { BBS Phone Number }
  11.      name,                                    { BBS Name }
  12.      sysop          : string[30];             { BBS SysOp Name }
  13.      description    : string[30];             { Other Description }
  14.      speed          : string[4];              { Speed }
  15.      software       : string[8];              { Software }
  16.      firstdate,                               { First date added }
  17.      lastedit       : unixtime;               { Last date edited }
  18.      editor         : string[36];             { entry editor }
  19.   end;
  20.  
  21. VAR BBSFILE:file of bbslistrec;
  22.     BBSNUM:bbslistrec;
  23.     PATH,TEMPSTR:STRING;
  24.     NUM,TEMPNUM,CURNUM:INTEGER;
  25.  
  26. function exist(filename:string):boolean;
  27.   var tfile:text;
  28.       s: string;
  29.   begin
  30.     s := FSEARCH(Filename,'');
  31.     exist := s <> '';
  32.   end;
  33.  
  34. procedure stringedit(var stringname:string);
  35. var tt:string;
  36. begin
  37. WRITELN;
  38. writeln('Previous string : '+Stringname);
  39.   write('Current string  : ');readln(tt);
  40. if length(tt)>0 then stringname:=tt;
  41. end;
  42.  
  43. procedure goprogram;
  44. VAR A:CHAR;
  45. begin
  46. CURnum:=0;
  47. STR(NUM,TEMPSTR);
  48. writeln('There are currently '+TEMPSTR+' BBS''s in '+PATH);
  49. delay(500);
  50. reset(BBSFILE);
  51. Seek(BBSFILE,CURnum);
  52. Read(BBSFILE,BBSNUM);
  53. repeat
  54. CLRSCR;
  55. str(curnum+1,tempstr);
  56. writeln('BBS Entry #'+tempstr);
  57. writeln('[1] BBS Name     = '+BBSNuM.name);
  58. writeln('[2] Phone Number = '+BBSNuM.phone);
  59. writeln('[3] Sysop Name   = '+BBSNuM.sysop);
  60. writeln('[4] Description  = '+BBSNuM.description);
  61. writeln('[5] Modem Speed  = '+BBSNuM.speed);
  62. writeln('[6] Software     = '+BBSNum.software);
  63. writeln('[G] Goto BBS Number, ] move one directory ahead, [ move one directory back');
  64. writeln('or hit [*] to clear this entry, and [S] to save this BBS entry');
  65. write('1-6,*,[,],G,or (Q = Quit) : ');repeat until keypressed;a:=readkey;
  66. a:=upcase(a);
  67. case a of
  68. '1','2','3','4','5','6':begin
  69.                         if a='1' then TEMPSTR:=BBSNUM.name;
  70.                         if a='2' then TEMPSTR:=BBSNUM.phone;
  71.                         if a='3' then TEMPSTR:=BBSNUM.sysop;
  72.                         if a='4' then TEMPSTR:=BBSNUM.description;
  73.                         if a='5' then TEMPSTR:=BBSNUM.speed;
  74.                         if a='6' then TEMPSTR:=BBSNUM.software;
  75.                         STRINGEDIT(TEMPSTR);
  76.                         if a='1' then BBSNUM.name:=TEMPSTR;
  77.                         if a='2' then BBSNUM.phone:=TEMPSTR;
  78.                         if a='3' then BBSNUM.sysop:=TEMPSTR;
  79.                         if a='4' then BBSNUM.description:=TEMPSTR;
  80.                         if a='5' then BBSNUM.speed:=TEMPSTR;
  81.                         if a='6' then BBSNUM.software:=TEMPSTR;
  82.                         end;
  83. 'G':begin
  84.     WRITELN;WRITELN;
  85.     STR(NUM,TEMPSTR);
  86.     write('Jump to which entry? (1-'+TEMPSTR+') :');readln(tempnum);
  87.     if (tempnum<=num) AND (tempnum > 0) then begin
  88.     CURNUM:=TEMPNUM-1;
  89.     RESET(BBSFILE);
  90.     Seek(BBSFILE,CURNUM);
  91.     Read(BBSFILE,BBSNUM);
  92.     end;
  93.     end;
  94. '[':if (CURnum-1 >= 0) then begin
  95.     CURNUM:=CURNUM-1;
  96.     RESET(BBSFILE);
  97.     Seek(BBSFILE,CURNUM);
  98.     Read(BBSFILE,BBSNUM);
  99.     end;
  100. ']':if (CURnum+1 < num) then begin
  101.     CURNUM:=CURNUM+1;
  102.     RESET(BBSFILE);
  103.     Seek(BBSFILE,curnum);
  104.     Read(BBSFILE,BBSNUM);
  105.     end;
  106. '*':begin
  107.     tempstr:='';
  108.     BBSNUM.name:=TEMPSTR;
  109.     BBSNUM.phone:=TEMPSTR;
  110.     BBSNUM.sysop:=TEMPSTR;
  111.     BBSNUM.description:=TEMPSTR;
  112.     BBSNUM.speed:=TEMPSTR;
  113.     BBSNUM.software:=TEMPSTR;
  114.     end;
  115. 'S':BEGIN
  116.     RESET(BBSFILE);
  117.     SEEK(BBSFILE,CURNUM);
  118.     write(BBSFILE,BBSNUM);
  119.     END;
  120. end;
  121. until A='Q';
  122. end;
  123.  
  124. BEGIN
  125. path:=paramstr(1);
  126. if (length(path) < 1)  then begin
  127.    WRITELN;WRITELN;
  128.    writeln('What is the path and filename of the Telegard BBS List?');
  129.    write('(Default = C:\TG\DATA\BBSLIST.BBS) : ');Readln(Path);
  130. end;
  131. if (length(path) < 1) then path := 'C:\TG\DATA\BBSLIST.BBS';
  132. if not(exist(path)) then begin
  133.    writeln;
  134.    writeln('Path not found error');
  135.    writeln('Proper command line = TGBBSED.EXE C:\TG\DATA\BBSLIST.BBS');
  136.    halt(0);
  137.    end;
  138. assign(BBSFILE,Path);
  139. reset(BBSFILE);
  140. num:=0;
  141. repeat
  142. read(BBSFILE,BBSNUM);
  143. inc(NUM);
  144. until eof(BBSFILE);
  145. GOPROGRAM;
  146. close(BBSFILE);
  147. END.